use "C:\Users\ibo6\OneDrive - The Pennsylvania State University\Working Papers\Target Hardening\v10 Terrorism and Political Violence\R & R\Analysis\rdyads2.dta", replace

generate hard_log = log(hard + 1)
generate civi_log = log(civi + 1)
generate mili_log = log(mili + 1)

** Model 25: Soft Targets (extended)
regress soft_log str_intel_log_l a_l suictot_l coin_deaths_log_l inten epr ib2.ideology, vce(cluster dyadid)
estimates store t1_soft_extended
** Model 26: Civilian Targets Only (extended)
regress civi_log str_intel_log_l a_l suictot_l coin_deaths_log_l inten epr ib2.ideology,  vce(cluster dyadid)
estimates store t1_civi_extended
** Model 27: Hard Targets (extended)
regress hard_log str_intel_log_l a_l suictot_l coin_deaths_log_l inten epr ib2.ideology, vce(cluster dyadid)
estimates store t1_hard_extended
** Model 28: Mlitary Targets Only (extended)
regress mili_log str_intel_log_l a_l suictot_l coin_deaths_log_l inten epr ib2.ideology, vce(cluster dyadid)
estimates store t1_mili_extended

ssc install estout
label variable str_intel_log_l "Hardening (lagged)"
label variable a_l "Success rate against hard targets (lagged)"
label variable suictot_l "Ratio of suicide attacks (lagged)"
label variable coin_deaths_log_l "COIN casualties (lagged)"
label variable inten "Conflict intensity"
label variable epr "Ethnic fractionalization"
label variable ideology "Group ideology"
label variable mao "Maoist insurgency"
label variable kashmir "Kashmir insurgency"
label variable north "Northeast insurgency"


label define ideology 1 "Ethnonationalist" 2 "Religious" 3 "Leftist" 4 "Other"
label values ideology ideology

esttab t1_soft_extended t1_civi_extended t1_hard_extended t1_mili_extended using apptable6A.csv, b(%5.3f) mlabel("Soft" "Civilian" "Hard" "Military") se starlevels(* 0.1 ** 0.05 *** 0.01) label noconstant nobaselevels title("OLS Models of Target Selection in Relevant State-Group Dyads in India, 2004-2016") addnotes("The dependent variables are the number attacks against respective target types in a given relevant state-group dyad in a given year. Robust standard errors clustered on relevant state-group dyads are presented in parantheses.")